package com.jgame.secondarymarket.domain.account.repository.db;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jgame.secondarymarket.domain.account.entity.Account;
import com.jgame.secondarymarket.domain.account.repository.AccountRepository;
import com.jgame.secondarymarket.domain.account.repository.db.mapper.AccountMapper;
import org.springframework.stereotype.Service;

/**
 * @title: AccountRespositoryImpl
 * @Author Wangsj
 * @Date: 2021/7/16
 */
@Service
public class AccountRespositoryImpl extends ServiceImpl<AccountMapper, Account> implements AccountRepository {


    @Override
    public Account findByUserName(String userName) {
        return getOne(new QueryWrapper<Account>().lambda().eq(Account::getUserName, userName).last("limit 1"));
    }
}
